package article_management;
public class Main {
	private PaginationProcess pg=new PaginationProcess();
	private InputIO in=new InputIO();
	private ArticalProcess ap=new ArticalProcess();
	private Display dis=new Display();
	static public String shortcutString="";
	public Main(){
		Design();
	}
	public void Design(){
		String option="";
		do{
			pg.ShowPagination();
			dis.ShowSelectMenu();
			option=in.getOption();
			try{
				switch(option){
					case "p":pg.SetRowPage();break;// set number of rows per page
					case "0":pg.FirstPage();break;// move to first page
					case "1":pg.BackPage();break;// move to back page
					case "2":pg.NextPage();break;// move to next page
					case "3":pg.LastPage();break;// move to last page
					case "n":
					case "4":pg.NextToPage();break;// set specific page
					case "r":
					case "5":ap.ReadData();break;// read data from file
					case "w":
					case "6":ap.WriteData();break;// write data to file 
					case "d":
					case "7":ap.DeleteData();break;// delete data from file
					case "u":
					case "8":ap.UpdateData();break;// update new data
					case "s":ap.SearchData();break;// search data from file
					case "m":pg.BackToMain(); break;// back to main page
					case "9":ap.RestoreData();break;// restore data 
					case "b":pg.BackToMainRestore();break;// back to main restore
					case "e":System.out.println("Exit....");return;// exite system
				}		
			}catch(Exception e){
				System.out.println(e.getMessage());
			}
		}while(true);
	}	
	public static void main(String[]args){
		new Main();
	}
}
